package com.itheima.tliasproject.mapper;


import com.itheima.tliasproject.pojo.Dept;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface DeptMapper {
//查询部门信息
    @Select("select * from dept")
    List<Dept> List();

    //根据ID删除部门
    @Delete("delete from dept where id = #{id}")
    void delete(Integer id);

    //新增部门
    @Insert("insert into dept(name,update_time,create_time) values (#{name},#{updateTime},#{createTime})")
    void Insert(Dept dept);

    //根据ID查询部门
    @Select("select * from dept where  id = #{id}")
   Dept GetById(Integer id);

    //修改部门
    @Update("update dept set name = #{name},update_time = #{updateTime} where id = #{id} ")
    void Updata(Dept dept);
}
